Conversation
Deleting Canvas tokens causes some of our downstream apps a lot of heartache. We almost never want to delete them.
We don't want to delete tokens when Canvas might succeed later at refreshing.
app/models/user.rb
Outdated
| :recoverable, :rememberable, :trackable, :validatable, :omniauthable | ||
|
|
||
| has_many :authentications, dependent: :destroy, inverse_of: :user | ||
| has_many :authentications, inverse_of: :user |
There was a problem hiding this comment.
Rails/HasManyOrHasOneDependent: Specify a :dependent option.
There was a problem hiding this comment.
If we do want this change, we should probably use dependent: :nullify https://guides.rubyonrails.org/association_basics.html#dependent
app/models/canvas_course.rb
Outdated
| @@ -1,3 +1,3 @@ | |||
| class CanvasCourse < ApplicationRecord | |||
| has_many :authentications, dependent: :destroy, inverse_of: :canvas_course | |||
| has_many :authentications, inverse_of: :canvas_course | |||
There was a problem hiding this comment.
Rails/HasManyOrHasOneDependent: Specify a :dependent option.
There was a problem hiding this comment.
If we do want this change, we should probably use dependent: :nullify https://guides.rubyonrails.org/association_basics.html#dependent
|
@dspencer001 What scenario do you have in mind that you would want the authentication to stick around after either the course or user model are deleted? |
|
@bfcoder We have users getting unexpectedly deleted in Search, and probably other places as well. In the cases I've noticed it is the user we create specifically for search, so there shouldn't be any reason for that user to be deleted. This would let the token at least stick around and not break anything that depends on it. |
|
Interesting. ok, well I've left a comment on the |
No description provided.